package com.imooc.bilibili.domain.video;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.imooc.bilibili.domain.user.UserInfo;
import lombok.Data;
import lombok.Value;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 视频评论表
 * </p>
 *
 * @author gcq
 * @since 2022-06-04
 */
@Data
@TableName("t_video_comment")
public class VideoComment implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键id
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 视频id
     */
    @TableField(value = "videoId")
    @NotNull(message = "videoId不能为空")
    private Long videoId;

    /**
     * 用户id
     */
    @TableField(value = "userId")
    private Long userId;

    /**
     * 评论
     */
    private String comment;

    /**
     * 回复用户id
     */
    @TableField(value = "replyUserId")
    private Long replyUserId;

    /**
     * 根节点评论id
     */
    @TableField(value = "rootId")
    private Long rootId;

    /**
     * 创建时间
     */
    @TableField(value = "createTime")
    private Date createTime;

    /**
     * 更新时间
     */
    @TableField(value = "updateTime")
    private Date updateTime;
    /**
     * 链表
     * 二级评论
     */
    @TableField(exist = false)
    private List<VideoComment> videoCommentList;

    /**
     * 关联的用户信息
     */
    @TableField(exist = false)
    private UserInfo userInfo;

    /**
     * 回复用户信息
     */
    @TableField(exist = false)
    private UserInfo replyUserInfo;
}
